﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Threading.Tasks;
using Api.Filter;
using Customer.Bussiness_Service;
using Entity;
using Microsoft.AspNetCore.Http;
using Microsoft.AspNetCore.Mvc;
using ServiceCore;

namespace Customer.Areas.rk_replenishment.Controllers
{

    [ApiController, Area("rk_replenishment"), Route("/replenishment/[action]"), RK_Admin]
    public class replenishmentController : ControllerBase
    {
        private readonly Ireplenishment_service _service;
        private readonly IToole_DI _tool;
        public replenishmentController(Ireplenishment_service service, IToole_DI tool)
        {
            _service = service;
            _tool = tool;
        }
        /// <summary>
        ///  获取缺货列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpPost]
        public ResultListModel<out_of_stock_mch_item> get_out_of_stock_pagelist(out_of_stock_mch_search query)
        {
            var result = _service.get_out_of_stock_pagelist(query);
            return result;
        } 
        /// <summary>
        ///  获取缺货列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpPost]
        public ResultListModel<get_out_of_stock_details_item> get_out_of_stock_details_pagelist(get_out_of_stock_detials_query query)
        {
            var result = _service.get_out_of_stock_details_pagelist(query);
            return result;
        } 
        /// <summary>
        /// 下载缺货列表信息
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpPost]
        public void out_of_stock_details_down([FromForm]get_out_of_stock_detials_query Params)
        {
            _service.out_of_stock_details_down(Params);
        }

        /// <summary>
        ///  查询补货记录列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpPost]
        public ResultListModel<replenishment_record_list_item> get_record_pagelist(replenishment_record_query query)
        {
            var result = _service.get_replenishment_record_pagelist(query);
            return result;
        }


        /// <summary>
        ///  查询补货记录列表
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpPost]
        public ResultListModel<replenishment_record_details> get_record_details_pagelist(replenishment_record_details_query query)
        {
            var result = _service.get_replenishment_record_details_pagelist(query);
            return result;
        } 
        /// <summary>
        /// 下载补货记录详情
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpPost]
        public void record_details_down([FromForm]replenishment_record_details_query Params)
        {
            _service.replenishment_record_details_down(Params);
        }

        /// <summary>
        /// 下载补货记录详情
        /// </summary>
        /// <param name="query"></param>
        /// <returns></returns>
        [HttpGet]
        public ResultObjModel get_kid_user()
        {
            return _service.get_kid_user();
        }
    }
}